package edu.arizona.mindseye.swing.listeners;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import edu.arizona.mindseye.event.Event;
import edu.arizona.mindseye.event.EventManager;
import edu.arizona.mindseye.event.enums.EventType;
import edu.arizona.mindseye.event.enums.Parameter;

public class FrameDeltaListener implements ActionListener {

	private int _delta;
	
	public FrameDeltaListener(int delta) { 
		_delta = delta;
	}
	
	/**
	 * When a button press happens generate the correct
	 * event and forward it on to the listeners.
	 */
	public void actionPerformed(ActionEvent actionEvent) { 
		Event e = new Event(EventType.FRAME_DELTA_COMMAND);
		e.addParameter(Parameter.delta, _delta);
		EventManager.inst().dispatch(e);
	}
}
